package fr.uniscol.siecle.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class MEF implements Serializable, DonneeSiecle {

	private String code = null;
	
	private String formation = null;
	
	private String specialite = null;
	
	private String libelleLong = null;
	
	private String libelleEdition = null;
	
	private String statut = null;
	
	private String mefStat = null;
	
	private int nbrOptionsObligatoires = 0;
	
	private int nbrOptionsMinimums = 0;
	
	private int nbrOptionsRenfLangues = 0;
	
	private Date dateOuverture = null;
	
	private Date dateFermeture = null;
	
	private List<MEF> mefsRattachements = null;

	public MEF() {
		super();
	}

	public MEF(String code) {
		super();
		this.code = code;
	}

	public String getCode() {
		if(code == null){
			code = "";
		}
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getFormation() {
		if(formation == null){
			formation = "";
		}
		return formation;
	}

	public void setFormation(String formation) {
		this.formation = formation;
	}

	public String getSpecialite() {
		if(specialite == null){
			specialite = "";
		}
		return specialite;
	}

	public void setSpecialite(String specialite) {
		this.specialite = specialite;
	}

	public String getLibelleLong() {
		if(libelleLong == null){
			libelleLong = "";
		}
		return libelleLong;
	}

	public void setLibelleLong(String libelleLong) {
		this.libelleLong = libelleLong;
	}

	public String getLibelleEdition() {
		if(libelleEdition == null){
			libelleEdition = "";
		}
		return libelleEdition;
	}

	public void setLibelleEdition(String libelleEdition) {
		this.libelleEdition = libelleEdition;
	}

	public String getStatut() {
		if(statut == null){
			statut = "";
		}
		return statut;
	}

	public void setStatut(String statut) {
		this.statut = statut;
	}

	public String getMefStat() {
		return mefStat;
	}

	public void setMefStat(String mefStat) {
		this.mefStat = mefStat;
	}

	public int getNbrOptionsObligatoires() {
		return nbrOptionsObligatoires;
	}

	public void setNbrOptionsObligatoires(int nbrOptionsObligatoires) {
		this.nbrOptionsObligatoires = nbrOptionsObligatoires;
	}

	public int getNbrOptionsMinimums() {
		return nbrOptionsMinimums;
	}

	public void setNbrOptionsMinimums(int nbrOptionsMinimums) {
		this.nbrOptionsMinimums = nbrOptionsMinimums;
	}

	public int getNbrOptionsRenfLangues() {
		return nbrOptionsRenfLangues;
	}

	public void setNbrOptionsRenfLangues(int nbrOptionsRenfLangues) {
		this.nbrOptionsRenfLangues = nbrOptionsRenfLangues;
	}

	public Date getDateOuverture() {
		return dateOuverture;
	}

	public void setDateOuverture(Date dateOuverture) {
		this.dateOuverture = dateOuverture;
	}

	public Date getDateFermeture() {
		return dateFermeture;
	}

	public void setDateFermeture(Date dateFermeture) {
		this.dateFermeture = dateFermeture;
	}

	public List<MEF> getMefsRattachements() {
		if(mefsRattachements == null){
			mefsRattachements = new ArrayList<MEF>();
		}
		return mefsRattachements;
	}

	public void setMefsRattachements(List<MEF> mefsRattachements) {
		this.mefsRattachements = mefsRattachements;
	}

	@Override
	public boolean equals(Object obj) {
		MEF m = (MEF)obj;
		return getCode().equalsIgnoreCase(m.getCode());
	}
}
